<?php

require_once(LIB_PATH.'/libRVT.php');

$rvt = new RVT();

if ( isset($_POST['action']) ){
	switch ($_POST['action']){
		case "info":
			if ( isset($_POST['inode']) && isset($_POST['part']) ){
				$part = $rvt->getPartition($_POST['part']);
				$p = split("-",$_POST['part']);
				$case = $rvt->getCase($p[0]);
				$path = $conf['morgue_path'].'/images/'.$case['name'].'-'.$case['code'].'/'.$p[0].'-'.$p[1].'-'.$p[2].'.dd';
				$output = array();
				exec('istat -o '.$part['osects'].' "'.$path.'" '.$_POST['inode'].' 2>&1', $output);
				foreach($output as $line){
					echo preg_replace("/^([^:]+)/","<b>$1</b>",$line)."<br/>";
				}
			}
			break;
	}
}

$smarty->display($_POST['mod'].'.tpl');

?>
